We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
类似于表单可以将表单项名称根据后面的冒号对其。效果如下:
重点是 CSS 样式,和 React 无关,只是方便渲染
结构
const mockData = [ {name: '1号窗口', value: '001'}, {name: '11号窗口', value: '003'}, {name: '91号窗口', value: '——'}, {name: '471号窗口', value: '178'}, {name: '33号窗口', value: '999'}, {name: '2号窗口', value: '061'}, ]; // ... function App() { // ... return ( <div className="box"> { mockData.map(item => ( <div key={item.name} className="item"> <div className="name">{item.name}: </div> <div className="value">{`${item.value}号客户`}</div> </div> )) } </div> ); }
样式
.item { display: table-row; } .name { display: table-cell; text-align: right; } .value { display: table-cell; }
很基础的实现,但是效果很好,代码也很简单。 需要注意的是要 显式 的给类名为 item 的元素设置 display: table-row;。否 text-align: right; 不生效。
item
display: table-row;
text-align: right;
The text was updated successfully, but these errors were encountered:
display:table-cell;
No branches or pull requests
类似于表单可以将表单项名称根据后面的冒号对其。效果如下:
结构
样式
很基础的实现,但是效果很好,代码也很简单。
需要注意的是要 显式 的给类名为
item
的元素设置display: table-row;
。否text-align: right;
不生效。The text was updated successfully, but these errors were encountered: