PDA

View Full Version : HTML Table Converted to BBCode


ChefBryardee
10-13-2017, 03:50 AM
I posted an HTML table in one of my threads and it converted the coding from the standard <td> elements to [TD] elements and it completely disregarded all the <style> coding I made. I enabled HTML coding in the forum, but it still went haywire.

Any ideas?

ChefBryardee
10-15-2017, 05:59 AM
Bump

ChefBryardee
10-18-2017, 11:48 PM
Any help?

blind-eddie
10-19-2017, 10:10 AM
Show us your bbcode for this please.

ChefBryardee
10-20-2017, 12:45 AM
It changes this original coding;

<!DOCTYPE html>
<html>
<head>
<style>
table {
height: auto;
width: 750px;
border: 3px solid grey;
border-collapse: collapse;
font-family: Droid Sans;
}
th {
height: auto;
width: 50%;
border: 3px solid grey;
border-collapse: collapse;
padding: 5px;
font-family: Droid Serif;
color: #B21A41;
}
td {
height: auto;
width: 50%;
padding: 10px;
}
td.stats {
height: auto;
width: 50%;
padding-left: 30px;
padding-right: 30px;
}
td.back {
height: auto;
width: 100%;
padding-top: 10px;
padding-bottom: 10px;
padding-left: 50px;
padding-right: 20px;
}
</style>
</head>
<body>
<table>
<tr>
<th colspan="2">TEST</th>
</tr>
<tr>
<td colspan="2" align="center">TEST</td>
</tr>
<tr>
<th>TEST</th>
<td class="stats" rowspan="2">TEST</td>
</tr>
<tr>
<td>TEST</td>
</tr>
<tr>
<th colspan="2">TEST</th>
</tr>
<tr>
<td class="back" colspan="2">TEST</td>
</tr>
</table>
</body>
</html>



Into this coding, and none of the styling is applying properly in the resulting table:

<style>
table {
height: auto;
width: 750px;
border: 3px solid grey;
border-collapse: collapse;
font-family: Droid Sans;
}
th {
height: auto;
width: 50%;
border: 3px solid grey;
border-collapse: collapse;
padding: 5px;
font-family: Droid Serif;
color: #B21A41;
}
td {
height: auto;
width: 50%;
padding: 10px;
}
td.stats {
height: auto;
width: 50%;
padding-left: 30px;
padding-right: 30px;
}
td.back {
height: auto;
width: 100%;
padding-top: 10px;
padding-bottom: 10px;
padding-left: 50px;
padding-right: 20px;
}
</style>























<tbody>
TEST


TEST


TEST
TEST


TEST


TEST


TEST

</tbody>

MarkFL
10-20-2017, 01:40 AM
First, I would highly recommend against allowing HTML to be posted, unless you are the only one allowed to post in the forum where you have it allowed.

I would move the CSS to your additional.css template, with the appropriate id/class selectors so that it affects table elements in your posts/post previews only.

I think the way I would go about it would be to create custom BBCodes to construct custom tables.

By the way, I tested your code on my local dev site, and while it was a mess, the HTML was not converted to BBCodes...I have no idea how that's happening unless you have custom code doing that. :)