Exemple de code pour implémenter la fusion de tables à l'aide de HTML5
Il existe de nombreux besoins de ce type. Par exemple, si les colonnes adjacentes d'un tableau ont le même contenu, alors un seul titre peut être utilisé. La fusion des titres est alors très importante, ce qui rend l'utilisateur plus humain. L'exemple de code est le suivant :
<!DOCTYPE html><html><head><meta charset= utf-8><meta name=author content=http://www.softwhy.com/ /><title>Boucle d'apprentissage frontale Web numéro : 731771211 quotidien Technologie de partage, échange académique</title><style type=text/css>body{ width:98%; height:100%; background-color:#FCF; text-align:center;}#tab{ width:100%; font-size:12px; Times, serif ; font-weight:bolder; background-color:#9F0;}</style></head><body><table id=tab cellpadding=1 Cellpacing=1 border=1> <tr> <th rowspan=2>Numéro de série</th> <th colspan=2>Wang Wu</th> <th colspan=2>Li Si</th> <th colspan=2>Soleil Chuan </th> <th colspan=2>Hu Ping</th> <th rowspan=2>Total</th> </tr> <tr> <th>Chinois</th> <th>Mathématiques</th > < th>Chinois</th> <th>Mathématiques</th> <th>Chinois</th> <th>Mathématiques</th> <th>Chinois</th> <th>Mathématiques</th> </tr> <tr> <th> 1</th> <th>78</th> <th>96</th> <th>67</th> <th>98</th> <th>88</th> <th>75< /th> <th>94</th> <th>69</th> <th> </th> </tr> <tr> <th>2</th> <th>89</th> <th>68</th> <th>77</th> <th>87</th > <th>84</th> <th>76</th> <th>71</th> <th>87</th> <th> </th> </tr> <tr> <th> 3</th> <th>75</th> <th>78</th> <th>89</th> <th>74</th> <th>65</th> <th>68</th> <th>98</th> <th >90</th> <th></th> </tr> <tr> <th>4</th> <th>79</th> <th>89</th> <th>65</ th> <th>62</th> <th>64</th> <th>87</th> <th>97</th> <th>91</th> <th></th> </tr> <tr> <th>5</th> <th>89 </th> <th>96</th> <th>67</th> <th>76</th> <th>74</th> <th>84</th> <th>67</ th> <th>81</th> <th></th> </tr> <tr> <th>6</th> <th>94</th> <th>90</th> <th>97</th> <th>74</th> <th>62</th > <th>81</th> <th>78</th> <th>78</th> <th></th> </tr> <tr> <th>7</th> <th> 78</th> <th>89</th> <th>77</th> <th>87</th> <th>45</th> <th>86</th> <th>77</th> <th>98</th> <th></th> </tr > <tr> <th>8</th> <th>65</th> <th>67</th> <th>94</th> <th>68</th> <th>87</ th> <th>69</th> <th>78</th> <th>68</th> <th></th> </tr> <tr> <th>9</th> <th>86</th> <th>98</th> <th>87 </th> <th>87</th> <th>65</th> <th>78</th> <th>98</th> <th>79</th> <th></th > </tr> <tr> <th>10</th> <th>88</th> <th>75</th> <th>77</th> <th>97</th> <th>97</th> <th>77</th> <th >70</th> <th>87</th> <th></th> </tr></table></body></html> RésumerCe qui précède est l'exemple de code que l'éditeur vous présente en utilisant HTML5 pour réaliser la fusion de tables. J'espère que cela vous sera utile. Si vous avez des questions, veuillez me laisser un message et l'éditeur vous répondra à temps. Je tiens également à remercier tout le monde pour votre soutien au site d'arts martiaux VeVb !
Si vous pensez que cet article vous est utile, n'hésitez pas à le réimprimer, veuillez indiquer la source, merci !