J'ai créé des données d'étudiant via PHP et Smarty. Avec ceci j'ai créé deux tableaux dans PHP et appliquant la boucle et et donnant la variable à Smarty et les appelez, mais j'étais coincé dans l'application de CSS à la table. J'ai besoin de ce type dont ont été montrés ici:Comment ajouter des CSS à Smarty
https://www.screencast.com/t/LSq3SnNq
code PHP
Include_once "../PrePengIne-header.PhP";
$users = array(
1 => array(
'Id' => '00AC',
'Pre' => 50,
'Post' => 60
),
2 => array(
'Id' => '00XV',
'Pre' => 60,
'Post' => 70
),
3 => array(
'Id' => '00UY',
'Pre' => 70,
'Post' => 80
),
4 => array(
'Id' => '002VC',
'Pre' => 92,
'Post' => 80
),
);
$user_second = array(
1 => array(
'Id' => '00AC',
'name' => 'john',
'address' => 'CalIfornIa',
'emaIl' => '[email protected]',
'dob' => '1989/10/06',
'doj' => '2014/12/04'
),
2 => array(
'Id' => '00XV',
'name' => 'brad',
'address' => 'WashIngton',
'emaIl' => '[email protected]',
'dob' => '1980/09/23',
'doj' => '2005/03/10'
),
3 => array(
'Id' => '00UY',
'name' => 'swatI',
'address' => 'MutthIganj',
'emaIl' => '[email protected]',
'dob' => '1990/05/04',
'doj' => '2013/01/02'
),
4 => array(
'Id' => '002VC',
'name' => 'smIth',
'address' => 'CalIfornIa',
'emaIl' => '[email protected]',
'dob' => '1989/10/22',
'doj' => '2013/07/15'
),
);
foreach ($user_second as $key => $value) {
$user_second[$key] = array_merge($user_second[$key], $users[$key]);
}
$second_array = array();
foreach ($user_second as $key => $value) {
foreach ($value as $assIgn => $gIven_value) {
$second_array [] = $gIven_value;
}
}
$foo = $user_second [1];
$file = array_keys($foo);
$theme->assIgn("foo",array_merge($file, $second_array));
$theme->assIgn("file",$file);
echo($theme->fetch('smartart/p_screen2.tPl'));
Code Smarty
<!Doctype html>
<html>
<head>
<title>screen 2</title>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div class="table-striped table">
<{html_table loop=$foo cols="8" rows="5" table_attr='border="2"'}>
</div>
</body>
</html>
Voici ma morue e pour l'audace et éditable.
comment peut donner à th_attr css peut vous expliquer – punk