+ 11
HTML HELP
how do i make a button output a table? after clicking a button this table will appear. Thanks so muchhh <html> <head> <title>Tabel</title> </head> <body> <table align="center" style="font-size:35" bgcolor="lightpink" cellpadding="15" cellspacing="5" border="1"> <tr> <td>31</td> <td>18</td> <td>27</td> <td>23</td> </tr> <tr> <td>17</td> <td>24</td> <td>29</td> <td>22</td>
12 Answers
+ 7
Yeah it will really need a JS codes.
+ 3
you have to add a custom id to your table tag and display the table none, then you need a js function and a button for display the table.
you can try below code...
YOUR HTML CODE...
<!DOCTYPE html>
<html>
<head>
<title>Tabel</title>
</head>
<body>
<table
id="demo"
align="center"
style="font-size:35;display:none;"
bgcolor="lightpink"
cellpadding="15"
cellspacing="5"
border="1">
<tr>
<td>31</td>
<td>18</td>
<td>27</td>
<td>23</td>
</tr>
<tr>
<td>17</td>
<td>24</td>
<td>29</td>
<td>22</td>
</tr>
</table>
<button type="button" onclick="table()">Click Me</button>
</body>
</html>
YOUR JAVASCRIPT CODE....
function table(){
document.getElementById("demo").style.display ="block";
}
+ 2
It... Will surely need js.
+ 2
Put it in a div container and make it display none in css then show it when ur button is active using active selector in css other wise u need js to show it using onclick!
+ 1
I expect it will need JavaScript.
Keep the table colour white by default.
On clicking the button, call a function that will make the table become black or any other colour.
I can't give you a code, coz I am weak in JavaScript...
+ 1
As many have already stated, to make a table appear when you click a button you have to learn JavaScript. JS is used more often to handle HTML events.
+ 1
First give an id attribute to that table next make a function in javascript that changes the display value of the table to none or block and you are ready
0
You need js code to output the table.
and form onclick event Html code
0
It's more easier using Javascript libraries like jQuery
0
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<button onclick="T()">Show</button>
</head>
<body>
<table border="2px" id="demo1" style="display:none">
<tr>
<td>
31
</td>
<td>
18
</td>
<td>27</td>
<td>23</td>
</tr>
<tr>
<td>17</td>
<td>24</td>
<td>29</td>
<td>22</td>
</tr>
</table>
<script>
function T() {
document.getElementById("demo1").style.display="block";
}
</script>
</body>
</html>
0
я не могу ответит на вопрос 1 вопрос 2там кароче я изучу HTML на Lo???
- 1
use js or jquery.