Does anyone know how to change row height and width or even break to a new line in css/html?
I have some long sentences in a row and they overlap each other rather than going to a new line? This makes the text unreadable. Please see screenshot of the issue.
I've also tried to set min-width values to the <td>
and <tr>
page elements.
But no effect. I've also set the table to width-100%; but the table won't stretch all the way across the screen.
I want it to look like this...the sentence continues below:
Instead...it does this...
As you can see , I can't even read the text in the table as the cells are pushing the text together. I want the cells to stretch to fit the text.
I've changed the width of one of the cells but the text still won't continue onto a different line. It just seems to be crammed in one cell.
css:
table {
width: 100%;
height: 30%;
border: 1px solid #ffffff;
border-spacing: 0;
border-collapse: collapse;
background-color: #ffffff;
}
tr:nth-child(even) {
background: #ffffff;
height:20%;
}
tfoot {
background: #e9e9e9;
font-weight: bold;
}
th {
text-transform: uppercase;
border-right: 1px solid #fff;
background: #ffffff;
border-bottom: 2px #fff solid;
color:#fff;
}
td, caption {
border-right: 1px solid #ffffff;
border-bottom: 1px solid #ffffff;
}
tr.even td {
background: #ffffff;
}
th, td, caption {
padding: 10px;
}
:before, :after {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.clearfix:before, .clearfix:after, .container:before, .container:after {
display: table;
content: " ";
}
.table-style2 th {
border-right-color: #fff;
border-bottom-color: #fff;
}
html:
<table border='1'>
<tr>
<th>ID</th>
<th>Title</th>
<th>Description</th>
<th>Location</th>
<th>Category</th>
</tr><tr><td style='height:10px; width:10px;'>1</td><td>example</td><td style='height:10px; width:100%;'>example text</td> <td>example city</td><td>example category</td> </tr>
<tr><td style='height:10px; width:10px;'>2</td><td>Banker</td><td style='height:10px; width:100%;'>Banking for clients</td> <td>Harrogate</td><td>banker</td> </tr>
<tr><td style='height:10px; width:10px;'>3</td><td>front end web developer</td><td style='height:10px; width:100%;'>front end web developer, create and maintain amazing websites. html5, css3, javascript skills needed.</td> <td>York</td><td>IT</td> </tr>
<tr><td style='height:10px; width:10px;'>4</td><td>front end web developer</td><td style='height:10px; width:100%;'>front end web developer, create and maintain amazing websites. html5, css3, javascript skills needed.</td> <td>harrogate</td><td>IT</td> </tr>
<tr><td style='height:10px; width:10px;'>5</td><td>Waiting Staff </td><td style='height:10px; width:100%;'>A history of table service is suitable but not essential as we provide thorough and comprehensive training on-site to provide our staff with the skills to excel. We’d like outgoing people motivated to wow our guests and who share our passion for outstanding service. Having been rated by our own staff in the Sunday Times 100 Best Companies surveys as one of the nation’s top hundred employers guarantees you that this will be a job like no other. We are currently the No.1 employer for having fu</td> <td>newcastle upon tyne</td><td>catering</td> </tr>
</table>