html - How to set the first name field on the same column as passport issue date
问题描述
I am trying to create a Basic Details form. In this i wan all the input field to appear in a tabular format. Is there any way to do that without using table tag
I have tried using css properties like display:flex and flexDirection but it is not working.
return (
<>
{/* Main Container Div */}
<div
style={{
display: "flex",
justifyContent: "space-evenly"
}}
>
{/* First Row Div starts */}
<div
style={{
display: "flex",
justifyContent: "center",
flexDirection: "column"
}}
>
<div>
<img
src="http://cetra.in/test2/profile_image.png"
alt="Profile"
style={{ width: "150px", height: "150px" }}
/>
</div>
<div>
<Button variant="contained" color="primary">
Upload Photo
</Button>
</div>
</div>
<div>
{/* First Row */}
<div style={styles.row_container}>
<div style={styles.row_items}>
<InputLabel shrink>Age</InputLabel>
<Select
margin="dense"
value={this.state.select_value}
onChange={e => {
this.handle_change(e.target.value);
}}
>
<MenuItem value="ms">Ms</MenuItem>
<MenuItem value="mrs">Mrs</MenuItem>
<MenuItem value="mr">Mr</MenuItem>
<MenuItem value="miss">Miss</MenuItem>
</Select>
</div>
<div style={styles.row_items}>
<TextField label="First Name" />
</div>
<div style={styles.row_items}>
<TextField label="Last Name" />
</div>
</div>
{/* First Row Ends */}
{/* Second Row */}
<div style={styles.row_container}>
<div style={styles.row_items}>
<FormLabel component="legend">Gender</FormLabel>
<RadioGroup
style={{
display: "flex",
flexDirection: "row"
}}
>
<FormControlLabel
control={<Radio />}
label="Male"
value="male"
/>
<FormControlLabel
control={<Radio />}
label="Female"
value="female"
/>
</RadioGroup>
</div>
<div style={styles.row_items}>
<MuiPickersUtilsProvider utils={DateFnsUtils}>
<DatePicker
clearable
value={null}
variant="inline"
label="Date of Birth"
/>
</MuiPickersUtilsProvider>
</div>
</div>
{/* Second Row Ends */}
{/* Third Row */}
<div style={styles.row_container}>
<div style={styles.row_items}>
<TextField label="Passport" />
</div>
<div style={styles.row_items}>
<MuiPickersUtilsProvider utils={DateFnsUtils}>
<DatePicker
clearable
value={null}
label="Passport Issue Date"
placeholder="Passport Issue Date"
/>
</MuiPickersUtilsProvider>
</div>
<div style={styles.row_items}>
<MuiPickersUtilsProvider utils={DateFnsUtils}>
<DatePicker
clearable
value={null}
label="Passport Expiration Date"
placeholder="Passport Expiration Date"
/>
</MuiPickersUtilsProvider>
</div>
</div>
{/* Third Row Ends */}
</div>
</div>
</>
);
I want the first name to appear as if it were in the same column as the passport issue date and second row should that is with two elements should have it's element on corners of that row.
解决方案
推荐阅读
- django - django SimpleListFilter中parameter_name的目的是什么?
- sql-server - 如何在从 docker-compose 调用的 .sh 文件中使用 .NET Core 机密
- c# - 如何创建其构造函数需要委托函数参数的泛型类型实例?
- r - R - 过滤数据中的负峰值和正峰值
- node.js - VS Code 中的终端无法执行节点命令行
- javascript - React Native - 来自 JSON 的地图数据可以显示为文本,但不能显示为地图标记坐标
- reactjs - 我想创建反应应用程序,但我不能。任何帮助将不胜感激
- r - 在 Shiny 中创建一个带有增量的 valueBox?
- postgresql - Postgres 持续显示高 CPU 使用率
- reporting-services - 同步 SSRS 中图表的系列组颜色