Stylised table is not working

Hello,

I created a table inside another table and when I tried to stylize it with background colours it didn’t work out correctly and the colours didn’t change afterall. Is there anything wrong with my code line or it is me that can’t create a stylize a table inside another table?

Cheers,
Rui

Hey @rcostaan,

There is a slight issue with your code. In case you wish to have a table inside a table, you can refer the code base below and customise it according to your requirement.

Here’s, the code snippet for a 2x2 table with an inherent 2x2 table :

<html>

<body>
	<table border="2" bordercolor="green">
		<tr>
			<td>Table 1</td>
			<td> Table 1
				<table border="2" bordercolor="blue" style="background-color:orange">
					<tr>
						<td>Table 2</td>
						<td>Table 2</td>
					</tr>
					<tr>
						<td> Table 2 </td>
						<td>Table 2</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td> Table 1 </td>
			<td> Table 1. </td>
		</tr>
	</table>
</body>

</html>

Refer the screenshot below for the output generated by the above code :
Screenshot 2022-10-03 at 16.14.36

As stated above, you can modify the HTML and add custom CSS meeting your requirements.

I hope this helps.

Regards,
Prakhar

Hello Prakhar,
I’m sorry, but this table is confusing for me. I don’t know any code at all and all I wanted to to is a table which contains a title and then a table inside with a different colour where I will write the content. Is it possible for you to send the code line similar to that so I can use it?

Best regards,
Rui

Hi Rui

I appreciate that you are inexperienced with HTML and ask for assistance. In fact, it is great to see that you wish to create something despite not knowing exactly how to get there! This is typically how people end up picking up new skills; such as working in HTML (which, whilst confusing at first glance, does not need to be enormously difficult to grasp!).

However, as a general rule of thumb, we do not assist in developing specific content for websites we are not directly responsible for. Whilst we are more than happy to provide pointers as Prakhar has done above, it is very important that those responsible for the content are the ones creating it. In this case for example, it would be immensely helpful for yourself, your team, and our team, if you are comfortable making adjustments to the table if such a request comes in, say, two months. That way, you do not end up having content on your website that you do not understand and have to rely on us to get updated, tweaked, or removed.

In order to better understand HTML and tables, please spend a bit of time reading through https://developer.mozilla.org/en-US/docs/Learn/HTML/Tables/Basics or, if you prefer a more interactive process, https://www.w3schools.com/html/html_tables.asp. Once you have the basics in place, you will be able to create the table structure you desire. In order to add colouring, you can refer to how Prakhar has done above, or the later sections of either of the abovementioned guides.

Thanks!

Hello,

I totally understand your point. I will follow the links you sent me and I will try to solve the situation on my own. Thank you so much both for your support.

Best regards,
Rui