欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  web前端

求教:如何用 angularjs 实现表格首列固定_html/css_WEB-ITnose

程序员文章站 2022-06-01 09:05:51
...
如题,这该如何解决呢?求各位大神给意见啊


回复讨论(解决方案)

没图帮不了你,说实话你完全可以这样,

第一列是一个表格,其余列是一个表格,这样就可以了

	我的笔记	
{{two.Name}} {{ two.Country }} {{two.Name}} {{ two.Country }} {{two.Name}} {{ two.Country }} {{two.Name}} {{ two.Country }} {{two.Name}} {{ two.Country }} {{two.Name}} {{ two.Country }} {{two.Name}} {{ two.Country }} {{two.Name}} {{ two.Country }} {{two.Name}} {{ two.Country }} {{two.Name}} {{ two.Country }} {{two.Name}} {{ two.Country }} {{two.Name}} {{ two.Country }} {{two.Name}} {{ two.Country }} {{two.Name}} {{ two.Country }}


myTodoApp.js:
var app = angular.module("myTodoApp",[]);


myTodoCtrl.js:
app.controller("myTodoCtrl",function($scope){	$scope.message="";	$scope.firstnames=[{"Name" : "Alfreds Futterkiste","City" : "Berlin","Country" : "Germany"},{"Name" : "Berglunds snabbköp","City" : "Luleå","Country" : "Sweden"},{"Name" : "Centro comercial Moctezuma","City" : "México D.F.","Country" : "Mexico"},{"Name" : "Ernst Handel","City" : "Graz","Country" : "Austria"},{"Name" : "FISSA Fabrica Inter. Salchichas S.A.","City" : "Madrid","Country" : "Spain"},{"Name" : "Galería del gastrónomo","City" : "Barcelona","Country" : "Spain"}];	$scope.twonames=[{"Name" : "Alfreds Futterkiste","City" : "Berlin","Country" : "Germany"},{"Name" : "Berglunds snabbköp","City" : "Luleå","Country" : "Sweden"},{"Name" : "Centro comercial Moctezuma","City" : "México D.F.","Country" : "Mexico"},{"Name" : "Ernst Handel","City" : "Graz","Country" : "Austria"},{"Name" : "FISSA Fabrica Inter. Salchichas S.A.","City" : "Madrid","Country" : "Spain"},{"Name" : "Galería del gastrónomo","City" : "Barcelona","Country" : "Spain"},{"Name" : "Island Trading","City" : "Cowes","Country" : "UK"},{"Name" : "Königlich Essen","City" : "Brandenburg","Country" : "Germany"},{"Name" : "Laughing Bacchus Wine Cellars","City" : "Vancouver","Country" : "Canada"},{"Name" : "Magazzini Alimentari Riuniti","City" : "Bergamo","Country" : "Italy"},{"Name" : "North/South","City" : "London","Country" : "UK"},{"Name" : "Paris spécialités","City" : "Paris","Country" : "France"},{"Name" : "Rattlesnake Canyon Grocery","City" : "Albuquerque","Country" : "USA"},{"Name" : "Simons bistro","City" : "København","Country" : "Denmark"},{"Name" : "The Big Cheese","City" : "Portland","Country" : "USA"},{"Name" : "Vaffeljernet","City" : "Århus","Country" : "Denmark"},{"Name" : "Wolski Zajazd","City" : "Warszawa","Country" : "Poland"}];	$scope.left=function(){ return 100- $scope.message.length;};	$scope.clear=function(){$scope.message="";};	$scope.save = function(){$scope.message="";};});


基本效果就是这样,具体你自己调整一下吧.

	我的笔记	
{{two.Name}} {{ two.Country }} {{two.Name}} {{ two.Country }} {{two.Name}} {{ two.Country }} {{two.Name}} {{ two.Country }} {{two.Name}} {{ two.Country }} {{two.Name}} {{ two.Country }} {{two.Name}} {{ two.Country }} {{two.Name}} {{ two.Country }} {{two.Name}} {{ two.Country }} {{two.Name}} {{ two.Country }} {{two.Name}} {{ two.Country }} {{two.Name}} {{ two.Country }} {{two.Name}} {{ two.Country }} {{two.Name}} {{ two.Country }}


myTodoApp.js:
var app = angular.module("myTodoApp",[]);


myTodoCtrl.js:
app.controller("myTodoCtrl",function($scope){	$scope.message="";	$scope.firstnames=[{"Name" : "Alfreds Futterkiste","City" : "Berlin","Country" : "Germany"},{"Name" : "Berglunds snabbköp","City" : "Luleå","Country" : "Sweden"},{"Name" : "Centro comercial Moctezuma","City" : "México D.F.","Country" : "Mexico"},{"Name" : "Ernst Handel","City" : "Graz","Country" : "Austria"},{"Name" : "FISSA Fabrica Inter. Salchichas S.A.","City" : "Madrid","Country" : "Spain"},{"Name" : "Galería del gastrónomo","City" : "Barcelona","Country" : "Spain"}];	$scope.twonames=[{"Name" : "Alfreds Futterkiste","City" : "Berlin","Country" : "Germany"},{"Name" : "Berglunds snabbköp","City" : "Luleå","Country" : "Sweden"},{"Name" : "Centro comercial Moctezuma","City" : "México D.F.","Country" : "Mexico"},{"Name" : "Ernst Handel","City" : "Graz","Country" : "Austria"},{"Name" : "FISSA Fabrica Inter. Salchichas S.A.","City" : "Madrid","Country" : "Spain"},{"Name" : "Galería del gastrónomo","City" : "Barcelona","Country" : "Spain"},{"Name" : "Island Trading","City" : "Cowes","Country" : "UK"},{"Name" : "Königlich Essen","City" : "Brandenburg","Country" : "Germany"},{"Name" : "Laughing Bacchus Wine Cellars","City" : "Vancouver","Country" : "Canada"},{"Name" : "Magazzini Alimentari Riuniti","City" : "Bergamo","Country" : "Italy"},{"Name" : "North/South","City" : "London","Country" : "UK"},{"Name" : "Paris spécialités","City" : "Paris","Country" : "France"},{"Name" : "Rattlesnake Canyon Grocery","City" : "Albuquerque","Country" : "USA"},{"Name" : "Simons bistro","City" : "København","Country" : "Denmark"},{"Name" : "The Big Cheese","City" : "Portland","Country" : "USA"},{"Name" : "Vaffeljernet","City" : "Århus","Country" : "Denmark"},{"Name" : "Wolski Zajazd","City" : "Warszawa","Country" : "Poland"}];	$scope.left=function(){ return 100- $scope.message.length;};	$scope.clear=function(){$scope.message="";};	$scope.save = function(){$scope.message="";};});


基本效果就是这样,具体你自己调整一下吧.

非常感,我尝试用两个表格显示吧。