I work on asp.net mvc i face issue on design html table . issue text of any feature wrap on new line and not alignment
so how to prevent text wraped on new line using html and css
so can any one help me
CSS
.employee-info {
display: flex;
justify-content: space-around;
}
.table-border-end {
height: 50px;
border-top: 2px solid gray;
border-bottom: 2px solid gray;
}
label {
display: block;
font-weight: bold;
margin-bottom: 5px;
}
label {
display: block;
margin-top: 8px;
font-weight: bold;
}
.requestInfo {
padding-top: 5px;
}
.flex {
display: flex;
}
.requestInfo-flex-div-1 {
width: 37mm;
}
.requestInfo-flex-div-4 {
width: 63mm;
border-bottom: solid 1px black;
text-align: center;
margin-left: 5px;
}
.requestInfo-flex-div-6 {
width: 40mm;
border-bottom: solid 1px black;
text-align: center;
margin-left: 5px;
}
.modelData {
font-size: 12px;
}
Emp. ID:
@Model.EmpID
:????? ???????
Emp.Name:
@Model.EmpName
:??? ??????
Dept./Branch:
@Model.Dept
:?????/??????
Designation :
@Model.Designation
:?????? ???????
Resignation Submittion Date:
@Model.ResignationSubmissionDate.ToString("dd/MM/yyyy")
:????? ????? ?????????
Mobile No:
@Model.MobileNo
:??? ??????
Employee Sign:
:????? ??????
Last Working Day:
@Model.LastWorkingDate.ToString("dd/MM/yyyy")
:??? ??? ???
The Reason of Resignation:
@Model.Reason
:??? ?????????my issue is text of feature display on two line
and i need it display as one line
as you see text underline red color as
resignation
submition
date
expected
resignation submition date
???
??????
expected
??? ??????


Sam HobbsRank #107 · 20.5K reputationPosted Jan 2, 2024, 5:03 PM EST
If I understand what you are saying then the problem is that there is not enough room for all of it to be in one line. The table cell for
The Reason of Resignation:haswidth:200pxand that apparently is too small. You must make the horizontal space larger somehow.ahmed salahRank #2,240 · 628 reputationPosted Jan 2, 2024, 5:06 PM EST
so how to modify it
please can you show me if possible please
Ali BenchaabanRank #925 · 2.2K reputationPosted Jan 2, 2024, 5:39 PM EST
Hello,
To achieve this you use white-space property of CSS. This property forces the contents of th to display in one line. There are many property values that exist in the white-space function.
white-space: normal|nowrap|pre|pre-wrap|pre-line;Try this example in jsfiddle uses white-space property to prevent cell wrapping using CSS.
https://jsfiddle.net/alibenchaaban/wmhudk4n/5/
Regards,
ahmed salahRank #2,240 · 628 reputationPosted Jan 2, 2024, 5:48 PM EST
ok can you show me how to use white-space: normal|nowrap|pre|pre-wrap|pre-line;
on my sample please
can you show me how to use it
Ali BenchaabanRank #925 · 2.2K reputationPosted Jan 3, 2024, 9:30 AM EST
Here is the implementation with your code by applying the
white-space: nowrap;property to thelabelselector in theEmployee Details .employee-info { display: flex; justify-content: space-around; } .table-border-end { height: 50px; border-top: 2px solid gray; border-bottom: 2px solid gray; } label { display: block; font-weight: bold; margin-bottom: 5px; white-space: nowrap; /* Prevents the label from breaking into multiple lines */ } .requestInfo { padding-top: 5px; } .flex { display: flex; } .requestInfo-flex-div-1 { width: 37mm; } .requestInfo-flex-div-4, .requestInfo-flex-div-6 { width: 300px; border-bottom: solid 1px black; text-align: center; margin-left: 5px; } .modelData { font-size: 12px; } Emp. ID: :TEST TEST_TESTPlease if it's Ok for you accept the solution to close the subject.
Regards,
BENCHAABAN Ali